package com.spark.incoicings.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spark.incoicings.dao.SalesOrderMapper;
import com.spark.incoicings.service.SalesOrderService;
import com.spark.incoicings.vo.SalesOrderVO;
import com.spark.invoicings.entity.SalesOrder;
import com.spark.invoicings.utils.Result;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOrder> implements SalesOrderService {

    @Resource
    private SalesOrderMapper salesOrderMapper;
    @Override
    public Result selectSalesCount() {
        List<SalesOrderVO> salesOrderVOS = salesOrderMapper.selectSalesCount();
        return Result.success(200,"success",salesOrderVOS);
    }

    @Override
    public Result selectSalesOrderAmount() {
        Integer selectSalesOrderAmount = salesOrderMapper.selectSalesOrderAmount();
        return Result.success(200,"success",selectSalesOrderAmount);
    }

    @Override
    public Result selectCustomerOrderCount() {
        List<SalesOrderVO> salesOrders = salesOrderMapper.selectCustomerOrderCount();
        return Result.success(200,"success",salesOrders);
    }

    @Override
    public Result selectSaleCount() {
        List<SalesOrderVO> salesOrders = salesOrderMapper.selectSaleCount();
        return Result.success(200,"success",salesOrders);
    }
    /**
     * 销售订单展示
     */
    @Override
    public List<SalesOrder> selectSalesOrderAll(Map<String, Object> map) {
        List<SalesOrder> salesOrders = salesOrderMapper.selectSalesOrderAll(map);
        return salesOrders;
    }
}
